package snailAI.Config;

import org.springframework.amqp.core.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AIEmailMqConfig {

    @Bean
    Queue emailQue1(){
        return new Queue("emailQue1");
    }
    @Bean
    Queue emailQue2(){
        return new Queue("emailQue2");
    }

    @Bean
    FanoutExchange emailFanoutExchange(){
        return new FanoutExchange("emailFanoutExchange");
    }
    @Bean
    Binding emailBinding1(@Qualifier("emailQue1") Queue emailQue1){
        return BindingBuilder.bind(emailQue1).to(emailFanoutExchange());
    }
    @Bean
    Binding emailBinding2(@Qualifier("emailQue2") Queue emailQue2){
        return BindingBuilder.bind(emailQue2).to(emailFanoutExchange());
    }

}
